package com.springcloud.consulprovider.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope
public class ProviderController {

    @GetMapping(value = "/hi")
    public String hi(@RequestParam("name") String name){
        return "consul provide" + name;
    }

    @Value("${osc.name}")
    private String name;

    @GetMapping(value = "/pull")
    public String getValue(){
        return name;
    }
}
